package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;
@Getter
@AllArgsConstructor
public enum SaasTaskTypeEnum {
    OPEN_WALLET_FOR_THE_FIRST_TIME(1, "首次开通钱包", false),
    FIRST_TIME_OPEN_WALLET_INVITATION(2, "邀请首次开通钱包", false),
    PURCHASE_SPECIFIED_IP_ITEMS(3, "购买指定IP商品", true),
    PURCHASE_OF_DESIGNATED_COLLECTION(4, "购买指定藏品", true),
    INVITATION_TO_PURCHASE_SPECIFIED_COLLECTIONS(5, "邀请购买指定藏品", true),
    NEW_USERS_MAKE_THEIR_FIRST_PURCHASE(6, "新用户首次购买", false),
    INVITE_NEW_USERS_TO_MAKE_THEIR_FIRST_PURCHASE(7, "邀请新用户首次购买", false),
    ACCUMULATED_CONSUMPTION_AMOUNT(8, "累计消费金额", false),
    BUY_BRAND_HATCHING_ANY_COLLECTION(9, "购买品牌孵化任意藏品", false),
    PURCHASE_PLATFORM_DEBUT_ANY_COLLECTION(10, "购买平台首发任意藏品", false),
    CDK_REDEMPTION_TASK(11, "CDK兑换任务", true),
    COMPOSITE_COLLECTION(12, "合成藏品", true),
    DISASSEMBLE_THE_COLLECTION(13, "分解藏品", true),
    SMELTING_COLLECTION(14, "熔炼藏品", true),
    FREE_MARKET_PURCHASE_OF_ANY_COLLECTION(15, "自由市场购买任意藏品", false),
    BUSINESS_CARD_BUY(16, "名片购买", false),
    SMELTING_APPOINT_COLLECTION(17, "熔炼指定藏品", true),
    SMELTING_WILL_COLLECTION(18, "熔炼任意藏品", false),
    PASSIVITY_INVITE_SMELTING_APPOINT_COLLECTION(19, "被邀请人熔炼指定藏品", true),
    PASSIVITY_INVITE_SMELTING_WILL_COLLECTION(20, "被邀请人熔炼任意藏品", false),

    ;

    @EnumValue
    private int code;

    private String desc;

    /**
     * 用来判定任务是否需要有额外的选项配置.比如需要选择指定的ip商城商品or自由市场藏品
     */
    private Boolean configuration;


    public static Map<String, String> getAll() {
        Map<String, String> map = Maps.newLinkedHashMap();
        for (SaasTaskTypeEnum value : SaasTaskTypeEnum.values()) {
            map.put(value.name(), value.getDesc());
        }
        return map;
    }
}
